package org.rsbot.event.impl;

import java.awt.Graphics;
import org.rsbot.bot.Bot;
import org.rsbot.client.Client;
import org.rsbot.client.input.Mouse;
import org.rsbot.event.listeners.TextPaintListener;
import org.rsbot.util.StringUtil;

public class TMousePosition
  implements TextPaintListener
{
  private Client client;

  public TMousePosition(Bot paramBot)
  {
    this.client = paramBot.getClient();
  }

  public int drawLine(Graphics paramGraphics, int paramInt) {
    Mouse localMouse = this.client.getMouse();
    if (localMouse != null) {
      int i = localMouse.getX();
      int j = localMouse.getY();
      String str = localMouse.isPresent() ? "" : " (off)";
      StringUtil.drawLine(paramGraphics, paramInt++, "Mouse Position: (" + i + "," + j + ")" + str);
    }

    return paramInt;
  }
}